home *** CD-ROM | disk | FTP | other *** search
/ MacPeople 1998 #2 / MACPEOPLE-1998-NO2.ISO / アップル関連 / ARA CO アップデート / モデム用 / DoCoMo 9600 Ver1.0 / DoCoMo 9600 Ver1.0 next >
Text File  |  1996-07-18  |  10KB  |  506 lines

  1. !**************************************************************************
  2. !    DoCoMo Digital DATA/FAX Adapter/Card 9600 FJH11/MAH12 V.1.12.  for  ARA version 2.0
  3. !    5/19/1994  (original AIWA PV-PF144 Direct)
  4. !    6/  7/1994  modify
  5. !               Written by Kenji Asaka
  6. ! 10/4/1995  modify
  7. !               Written by N.K.
  8. !
  9. !  'mlts' resource info for this modem:
  10. !    byte 1 == 01 -> modem HAS builtin reliability protocols
  11. !    byte 2 == 00 -> reserved by Apple
  12. !    byte 3 == FE -> max hex chars in varstr 7 (254 dec)
  13. !    byte 4 == FE -> max hex chars in varstr 8
  14. !    byte 5 == FE -> max hex chars in varstr 9
  15. !    
  16. !**************************************************************************
  17. @ORIGINATE
  18. @ANSWER
  19. !******************************************
  20. ! set up the modem - label range is 1-10
  21. !
  22. !
  23. !******************************************
  24. ! Mac talks to the modem at 19,200 bps.  
  25. DTRSet
  26. pause 15
  27. serreset 19200, 0, 8, 1
  28. !------------------------
  29. ! reset the serial port
  30. !------------------------
  31. HSReset 0 1 0 0 0 0
  32. !
  33. !
  34. !
  35. settries 0
  36. @LABEL 1
  37. matchclr
  38. matchstr 1 3 "OK¥13¥10"
  39. ! &F  - recall factory settings
  40. ! ¥Q3 - Enable CTS Hardware flow control
  41. ! S0=0 - Don't answer calls
  42. ! E0   - Turn command echo off
  43. write "AT&F¥¥V1E0S0=0¥¥Q3%C0¥¥N0¥¥X1¥13"
  44. matchread 30
  45. inctries
  46. iftries 2 81
  47. !------------------
  48. ! Reset the Modem 
  49. ! (DoCoMo Digital DATA/FAX Adapter9600 FJH11 SETTING)
  50. !-------------------
  51. DTRSet
  52. pause 10
  53. DTRClear
  54. pause 10
  55. DTRSet
  56. flush
  57. pause 10
  58. jump 1
  59. !
  60. !
  61. !
  62. @LABEL 3
  63. !-----------------------------------------
  64. ! Modem responding & configured.
  65. ! determine if reliable link is requested.
  66. !-----------------------------------------
  67. ! if modem mnp10 link requested (var 4 == 2) then jump label 4
  68. ifstr 4 4 "2"
  69. !
  70. ! if modem v42 link requested (var 4 == 1) then jump label 5
  71. ifstr 4 5 "1"
  72. !
  73. ! if no modem v42 link requested (var 4 == 0) [same as ARA 1.0] then jump label 9
  74. ifstr 4 9 "0"
  75. !
  76. ! else invalid value in var 4; exit w/error
  77. jump 86
  78. !
  79. !
  80. !
  81. @LABEL 4
  82. !--------------------------------
  83. ! yes, mnp 10 link is requested.
  84. !--------------------------------
  85. matchclr
  86. matchstr 1 7 "OK¥13¥10"
  87. ! ¥N3 - V42-MNP autoreliable mode.
  88. ! ¥J0 - Don't adjust Modem-DTE speed to connection speed. 
  89. ! ¥X0 - Enable MNP10
  90. write "AT¥¥N3¥¥X0¥13"
  91. matchread 300
  92. jump 81
  93. !
  94. !
  95. !
  96. @LABEL 5
  97. !-----------------------------------------------------
  98. ! yes, v42 link is requested.  OK for LAP-M -> MNP 4.
  99. !-----------------------------------------------------
  100. matchclr
  101. matchstr 1 7 "OK¥13¥10"
  102. ! ¥N3 - V42-MNP autoreliable mode.
  103. ! ¥J0 - Don't adjust Modem-DTE speed to connection speed. 
  104. ! ¥X1 - Disable MNP10
  105. write "AT¥¥N3¥¥X1¥13"
  106. matchread 300
  107. jump 81
  108. !
  109. !
  110. !
  111. @LABEL 7
  112. !------------------------------------------------------------------------
  113. ! If we DID support compression in the modem, this is where it would go.
  114. !------------------------------------------------------------------------
  115. !
  116. !
  117. !
  118. @LABEL 9
  119. !--------------------------------------------------------------------------
  120. ! If speaker on flag is true, jump to label 13.  Else turn off the speaker.
  121. !--------------------------------------------------------------------------
  122. ifstr 2 13 "1"
  123. pause 5
  124. matchclr
  125. matchstr 1 13 "OK¥13¥10"
  126. write "ATM0¥13"
  127. matchread 30
  128. jump 81
  129. !*******************************************************************************
  130. ! modem ready, so enable answering or originate a call - label range is 11-30
  131. !
  132. !
  133. !*******************************************************************************
  134. @LABEL 13
  135. pause 5
  136. ifANSWER 71
  137. !
  138. ! if normal dialing (parm 6 == 0) jump to 19
  139. ifstr 6 19 "0"
  140. !
  141. ! if blind dialing (parm 6 == 1) jump to 17
  142. ifstr 6 17 "1"
  143. !
  144. ! if manual dialing (parm 6 == 2) jump to 15 
  145. ifstr 6 15 "2"
  146. !
  147. ! else invalid value in var 6; exit w/error
  148. jump 86
  149. !
  150. !
  151. !
  152. @label 15
  153. note "手動ダイアル中。" 3
  154. ! "Manual dialing initiated" 3
  155. ! X1 to ignore dialtone & busy for manual dialing, D to dial
  156. write "ATX1D ¥13"
  157. jump 32
  158. !
  159. !
  160. !
  161. @label 17
  162. note "ダイアルトーンを無視してダイアル中。" 3
  163. ! "Dialing without tone" 3
  164. matchclr
  165. matchstr 1 19 "OK¥13¥10"
  166. ! X3 to ignore dialtone for blind dialing
  167. write "ATX3¥13"
  168. matchread 30
  169. jump 81
  170. !
  171. !
  172. !
  173. @label 19
  174. ! this is where we break up long dialstrings
  175. !
  176. ! parm 1 is always the full dialstring from the conn doc
  177. note "^1 をダイアル中。" 3
  178. ! "Dialing ^1" 3
  179. ! parm 3 is always "p" for pulse & "t" for tone
  180. !
  181. ! if parm 8 == blank (complete dialstring in parm 7)
  182. !  then jump to label 27 & dial parm 7
  183. ifstr 8 27 " "
  184. !
  185. ! if parm 9 == blank (complete dialstring in parms 7 & 8)
  186. !  then jump to label 24 & dial parm 7 & 8
  187. ifstr 9 24 " "
  188. !
  189. !  else dial parm 7 & 8 & 9 (complete dialstring in parms 7, 8 & 9)
  190. matchclr
  191. matchstr 1 21 "OK¥13¥10"
  192. ! parm 7 holds first string fragment
  193. write "ATD^3^7¥13"
  194. matchread 400
  195. ! modem not responding; bailout.
  196. jump 81
  197. !
  198. !
  199. !
  200. @label 21
  201. ! parm 8 holds second string fragment
  202. matchclr
  203. matchstr 1 22 "OK¥13¥10"
  204. write "ATD^3^8¥13"
  205. matchread 400
  206. ! modem not responding; bailout.
  207. jump 81
  208. !
  209. !
  210. !
  211. @label 22
  212. ! parm 9 holds last string fragment
  213. write "ATD^3^9¥13"
  214. jump 32
  215. !
  216. !
  217. !
  218. !
  219. @label 24
  220. matchclr
  221. matchstr 1 25 "OK¥13¥10"
  222. ! parm 7 holds first string fragment
  223. write "ATD^3^7¥13"
  224. matchread 400
  225. ! modem not responding; bailout.
  226. jump 81
  227. !
  228. !
  229. !
  230. @label 25
  231. ! parm 8 holds last string fragment
  232. write "ATD^3^8¥13"
  233. jump 32
  234. !
  235. !
  236. !
  237. @label 27
  238. ! parm 7 holds entire string
  239. write "ATD^3^7¥13"
  240. jump 32
  241. !***********************************************
  242. !    connecting - label range is 34-60
  243. !
  244. !
  245. !***********************************************
  246. @LABEL 32
  247. matchclr
  248. !
  249. matchstr 1  45 "CONNECT SERIAL 19200/"
  250. !
  251. matchstr 2  46 "PROTOCOL:NONE"
  252. matchstr 3  47 "MNP   <NONE>"
  253. matchstr 4  47 "MNP <NONE>"
  254. matchstr 5  48 "MNP4  <V.42bis>"
  255. matchstr 6  48 "MNP4 <V.42bis>"
  256. matchstr 7  49 "MNP5"
  257. matchstr 8  50 "MNP10 <NONE>"
  258. matchstr 9  51 "MNP10 <MNP5>"
  259. matchstr 10  52 "MNP10 <V.42bis>"
  260. matchstr 11  53 "LAPM  <NONE>"
  261. matchstr 12  53 "LAPM <NONE>"
  262. matchstr 13  54 "LAPM  <V.42bis>"
  263. matchstr 14  54 "LAPM <V.42bis>"
  264. !
  265. matchstr 15  55 "/CARRIER 1200¥13¥10"
  266. matchstr 16  56 "/CARRIER 2400¥13¥10"
  267. matchstr 17  57 "/CARRIER 4800¥13¥10"
  268. matchstr 18  58 "/CARRIER 7200¥13¥10"
  269. matchstr 19  59 "/CARRIER 9600¥13¥10"
  270. matchstr 20  60 "/CARRIER 12000¥13¥10"
  271. matchstr 21  61 "/CARRIER 14400¥13¥10"
  272. !
  273. ! for Digital Mova Connect-Result-Code
  274. matchstr 22 62 "CONNECT SERIAL 19200¥13¥10"
  275. !
  276. ! other connect speeds go below here
  277. !
  278. matchstr 23  72 "RING¥13¥10"
  279. !
  280. matchstr 24  82 "NO DIALTONE¥13¥10"
  281. matchstr 25  83 "NO CARRIER¥13¥10"
  282. matchstr 26  83 "ERROR¥13¥10"
  283. matchstr 27  84 "BUSY¥13¥10"
  284. matchstr 28  85 "NO ANSWER¥13¥10"
  285. matchstr 29  87 "/CARRIER 300¥13¥10"
  286. matchstr 30  88 "DELAYED¥13¥10"
  287. matchstr 31  88 "NOT READY¥13¥10"
  288. matchstr 32  89 "LOW BATTERY¥13¥10"
  289. !
  290. matchread 700
  291. ifANSWER 32
  292. jump 81
  293. !------------------------------------------------------------
  294. !  THIS v32b modem has been setup to do cts handshaking,
  295. !  and we assume that a cts handshaking cable is being used,
  296. !  so we leave the serial port set to 19,200 bps.
  297. !------------------------------------------------------------
  298. !
  299. @LABEL 45
  300. note "接続しました" 3
  301. ! "Communicating at 19200 bps." 2
  302. CommunicatingAt 19200
  303. jump 32
  304. !
  305. @LABEL 46
  306. note "ノーマルモードで接続しました" 3
  307. jump 32
  308. !
  309. @LABEL 47
  310. note "MNP4で接続しました" 3
  311. jump 32
  312. !
  313. @LABEL 48
  314. note "MNP&V.42bisで接続しました" 3
  315. jump 32
  316. !
  317. @LABEL 49
  318. note "MNP5で接続しました" 3
  319. jump 32
  320. !
  321. @LABEL 50
  322. note "MNP10で接続しました" 3
  323. jump 32
  324. !
  325. @LABEL 51
  326. note "MNP10&MNP5で接続しました" 3
  327. jump 32
  328. !
  329. @LABEL 52
  330. note "MNP10&V.42bisで接続しました" 3
  331. jump 32
  332. !
  333. @LABEL 53
  334. note "LAPMで接続しました" 3
  335. jump 32
  336. !
  337. @LABEL 54
  338. note "LAPM&V.42bisで接続しました" 3
  339. jump 32
  340. !
  341. @LABEL 55
  342. note "1200bpsで接続中(相手側通信速度)" 3
  343. jump 68
  344. !
  345. @LABEL 56
  346. note "2400bpsで接続中(相手側通信速度)" 3
  347. jump 68
  348. !
  349. @LABEL 57
  350. note "4800bpsで接続中(相手側通信速度)" 3
  351. jump 68
  352. !
  353. @LABEL 58
  354. note "7200bpsで接続中(相手側通信速度)" 3
  355. jump 68
  356. !
  357. @LABEL 59
  358. note "9600bpsで接続中(相手側通信速度)" 3
  359. jump 68
  360. !
  361. @LABEL 60
  362. note "12000bpsで接続中(相手側通信速度)" 3
  363. jump 68
  364. !
  365. @LABEL 61
  366. note "14400bpsで接続中(相手側通信速度)" 3
  367. jump 68
  368. !
  369. @LABEL 62
  370. note "デジタル携帯電話と接続しました" 3
  371. CommunicatingAt 19200
  372. jump 68
  373. !
  374. !
  375. !
  376. @LABEL 68
  377. ! turn on cts handshaking.
  378. HSReset 0 1 0 0 0 0
  379. !
  380. ifANSWER 69
  381. pause 30
  382. @LABEL 69
  383. exit 0
  384. !************************************************************
  385. ! @ANSWER
  386. ! Set the modem to answer on 1st ring - label range is 71-80
  387. !
  388. !************************************************************
  389. @LABEL 71
  390. matchclr
  391. matchstr 1 32 "OK¥13¥10"
  392. write "ATS0=1¥13"
  393. matchread 30
  394. jump 81
  395. !
  396. @LABEL 72
  397. ifORIGINATE 32
  398. ! claim the serial port
  399. userhook 1
  400. note "電話に応対しています。" 2
  401. ! "Answering phone..." 2
  402. jump 32
  403. !************************************************
  404. ! error messages - label range is 81-100
  405. !
  406. !
  407. !************************************************
  408. ! Modem Not Responding
  409. @LABEL 81
  410. exit -6019
  411. !
  412. ! No Dial Tone
  413. @LABEL 82
  414. exit -6020
  415. !
  416. ! No Carrier or Error
  417. @LABEL 83
  418. exit -6021
  419. !
  420. ! Busy
  421. @LABEL 84
  422. exit -6022
  423. !
  424. ! No Answer
  425. @LABEL 85
  426. exit -6023
  427. !
  428. ! varstring invalid value
  429. @LABEL 86
  430. exit -6027
  431. !
  432. ! Connect 300bps
  433. @LABEL 87
  434. exit -6002 "ARA は 300bps の接続に対応していません。"
  435. ! -6002 "ARA doesn't support 300bps connection."
  436. !
  437. ! DELAYED
  438. @LABEL 88
  439. exit -6022 "リダイヤル規制中です。1分後に発信して下さい"
  440. !
  441. ! LOW BATTERY
  442. @LABEL 89
  443. exit -6022 "アダプタの電池を交換して下さい"
  444. !
  445. !
  446. !********************************************
  447. ! Hang up the modem - label range is 101-120
  448. !********************************************
  449. @HANGUP
  450. @LABEL 102
  451. settries 0
  452. HSReset 0 0 0 0 0 0
  453. @LABEL 105
  454. !----------------------------
  455. ! firstly try escape sequence
  456. !----------------------------
  457. matchclr
  458. matchstr 1 108 "OK¥13¥10"
  459. pause 10
  460. write "+++"
  461. matchread 15
  462. !
  463. @LABEL 108
  464. !-------------------
  465. ! secondly try ATH
  466. !-------------------
  467. matchclr
  468. matchstr 1 111 "NO CARRIER¥13¥10"
  469. matchstr 2 111 "OK¥13¥10"
  470. matchstr 3 111 "ERROR¥13¥10"
  471. write "ATH¥13"
  472. matchread 30
  473. inctries
  474. iftries 3 81
  475. !---------------------------------------
  476. ! finaly try On-to-Off DTR transitions
  477. ! (DoCoMo Digital DATA/FAX Adapter9600 FJH11 SETTING)
  478. !---------------------------------------
  479. DTRSet
  480. pause 10
  481. DTRClear
  482. pause 10
  483. DTRSet
  484. flush
  485. pause 10
  486. jump 105
  487. !------------------------------
  488. ! recall the factory settings.
  489. !------------------------------
  490. @LABEL 111
  491. pause 15
  492. matchclr
  493. matchstr 1 114 "OK¥13¥10"
  494. write "AT&F¥¥V1E0S0=0¥¥Q3¥13"
  495. matchread 30
  496. jump 81
  497. !
  498. @LABEL 114
  499. exit 0
  500.  
  501. !*********************************************************
  502. ! labels 121-128 are reserved for future emergency hacks
  503. !
  504. !
  505. !********************************************************
  506.